#include <bits/stdc++.h>
#include <windows.h>

#define VNAME(name) (#name)
#define debug(x)                                                  \
    {                                                             \
        auto debugx = (x);                                        \
        std::cout << " (" << VNAME(x) << ": " << debugx << ")\n"; \
    }
#define F_(n) cout << fixed << setprecision(n)
#ifndef ONLINE_JUDGE
#else
#define endl '\n'
#endif
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e6 + 5;
const int MOD = 1e9 + 7;
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
bool _OJ_Flag = true;
int arr[N];
static int ____________________________________________________ = []()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    return 0;
}(); //*/
void solve(int n, int m)
{
    cout << "OKKOK";
}
signed main()
{
#ifndef ONLINE_JUDGE
    _OJ_Flag = false; //freopen("C:\\Users\\lenovo\\Desktop\\out.out", "w", stdout);
    LARGE_INTEGER tbegin, tend, tLasting;
    QueryPerformanceCounter(&tbegin); //tbegin.QuadPart;
#endif
    
    int n, m, k;
    cin >> m >> k;
    int C = k - m == 0 ? 1 : k - m;

    cout << rng() % C + k - C << '\n';

    #ifndef ONLINE_JUDGE
		//system("pause");
	#endif
    return 0;
}